<template>
	<n-config-provider
		:locale="locale"
		:theme="darkTheme"
		:date-locale="dateLocale"
		:theme-overrides="themeOverrides"
	>
		<n-dialog-provider>
			<n-message-provider>
				<n-loading-bar-provider>
					<c-message-content />
					<router-view />
				</n-loading-bar-provider>
			</n-message-provider>
		</n-dialog-provider>
	</n-config-provider>
</template>

<script setup lang="ts">
import { darkTheme } from 'naive-ui';
import { getNaiveLanguage } from '@/i18n';
import { themeOverrides } from '@/styles/naive/index';
import { CMessageContent } from '@/components/CMessageContent';

import { useDictionaryStore } from '@/store/modules/dictionary';

const dicStore = useDictionaryStore();
const { locale, dateLocale } = getNaiveLanguage();

function initDic() {
	dicStore.getDevTypeOption();
	dicStore.getSignalTypeOption();
	dicStore.getAlarmLevelOption();
	dicStore.getAlarmTypeOption();
}

initDic();
</script>

<style>
.n-config-provider {
	height: 100%;
}
</style>
